<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="../../Themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../CSS/demo.css">
    <link rel="stylesheet" type="text/css" href="../../Themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../../CSS/common.css">

</head>

<body style="padding: 0px;">
<div class="easyui-layout" style="width:100%;height:600px;">
    <div data-options="region:'center'">
        <div>
            <table id="dg" style="width: 100%;" class="table_style">
            </table>
        </div>
    </div>
</div>
<div id="toolbar"></div>

<script type="text/javascript" src="../../JS/jquery.min.js"></script>
<script type="text/javascript" src="../../JS/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../../JS/common.js"></script>
<script type="text/javascript" src='../../JS/SHA-1.js'></script>
<script type="text/javascript" src="./common.js"></script>
<script type="text/javascript" src="./SellOrderList.js"></script>
<script type="text/javascript">

    var content = "";
    content = AddToolBar(2 + TOOLBAR_REDO);
    $('#toolbar').append(content);
    var list = new SellOrderList();
    list.basicUrl = 'logistics/salesorder';
    list.addPageUrl = './SellOrderAdd.html';
    list.toolBarSelector = '#toolbar';
    list.columns = [
        [{
            field: 'cb',
            checkbox: 'true'
        }, {
            field: 'ID',
            title: 'ID',
            width: '0%',
            align: 'center'
        }, {
            field: 'ORDER_NO',
            title: '销售单号',
            width: '13%',
            align: 'center'
        }, {
            field: 'CUSTOMER_TYPE',
            title: '用户组',
            width: '13%',
            align: 'center'
        }, {
            field: 'CUSTOMER_NAME',
            title: '配送单位',
            width: '13%',
            align: 'center'
        }, {
            field: 'DISTRIBUTION_DATE',
            title: '配送时间',
            width: '13%',
            align: 'center'
        }, {
            field: 'LUMP_SUM',
            title: '总价',
            width: '13%',
            align: 'center',
            formatter: function (value, row, index) {
                if (value) {
                    return "￥" + value + "元";
                }
            }
        }, {
            field: 'STATE',
            title: '订单状态',
            width: "13%",
            align: 'center'
        }, {
            field: 'ISVERIFY',
            title: '审核状态',
            width: '14%',
            align: 'center',
            formatter: function (value, row, index) {
                return verifyStatus(value, false);
            }
        }]
    ];
    try {
        list.init();
    } catch (message) {
        $.messager.alert('错误', message, 'error');
    }

    $('#dg').datagrid({
        onDblClickRow: function (index, row) {
            try {
                list.currentId = row.ID;
            } catch (message) {
                $.messager.alert('错误', message, 'error');
            }
        }
    });

    function editdata() {
        var row = $('#dg').datagrid('getSelected');
        if (!row) {
            $.messager.alert('Info', '请选择你需要修改的数据');
            return;
        }
        list.currentId = row.ID;
    }
    
    function redodata() {
        list.searchWithParam({});
    }

</script>
</body>


</html>
